package com.sansheng.dao.impl;

import com.sansheng.base.BaseMongoDaoImpl;
import com.sansheng.dao.UserDao;
import com.sansheng.entity.user.User;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.data.mongodb.core.query.Criteria;
import org.springframework.data.mongodb.core.query.Query;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author 陈龙
 * @version 2017年09月10日 14时30分
 */
@Repository("userDao")
public class UserDaoImpl extends BaseMongoDaoImpl<User> implements UserDao {
    @Override
    public List<User> listUser() {
        Query query = new Query();
        Criteria criteria = new Criteria();
        query.addCriteria(criteria);
        return this.find(query);
    }

    @Override
    public void add(User user) {
        this.save(user);
    }
}
